unit MainEvaluation;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, RzButton, Grids, BaseGrid, AdvGrid, RzTabs, ExtCtrls, RzPanel,
  DB, ADODB, RzSpnEdt, RzStatus, StdCtrls, Mask, RzEdit, DBAdvGrd, RzRadChk,
  ComCtrls, RzDTP;

type
  TfrmEvaluatonModule = class(TForm)
    pnlMainTop: TRzPanel;
    pnlMainClient: TRzPanel;
    MainPageEmpEval: TRzPageControl;
    TabSheet1: TRzTabSheet;
    TabSheet2: TRzTabSheet;
    btnMainEvaluation: TRzBitBtn;
    btnMainClose: TRzBitBtn;
    QryEvalQuestioner: TADODataSet;
    dsEvalQuestioner: TDataSource;
    RzPanel1: TRzPanel;
    dsEmployee: TDataSource;
    QryEmployee: TADODataSet;
    btnMainViewSubjects: TRzBitBtn;
    QryEvalRecords: TADODataSet;
    dsEvalRecords: TDataSource;
    pnlMainBottom: TRzPanel;
    RzStatusBar1: TRzStatusBar;
    RzClockStatus1: TRzClockStatus;
    rzStatusMainEvaluation: TRzStatusPane;
    RzPanel2: TRzPanel;
    RzPanel35: TRzPanel;
    RzPanel36: TRzPanel;
    dbgridEvaluationSummary: TDBAdvStringGrid;
    RzPanel3: TRzPanel;
    RzPanel4: TRzPanel;
    gridEmpEvaluation: TAdvStringGrid;
    btnSubjectRemove: TRzBitBtn;
    btnSubjectAdd: TRzBitBtn;
    btnSubjectSearch: TRzBitBtn;
    edtSearchSubject: TRzEdit;
    spineditSubject: TRzSpinButtons;
    edtCurrentNameEmp: TRzEdit;
    cbMainFilterNavbar: TRzCheckBox;
    spinEmpSubject: TRzSpinButtons;
    RzPanel5: TRzPanel;
    edtActiveForEvaluation: TRzEdit;
    btnDoneEvaluation: TRzBitBtn;
    dtEvalDate: TRzDateTimePicker;
    btnLoginAs: TRzBitBtn;
    RzPageControl1: TRzPageControl;
    TabSheet3: TRzTabSheet;
    TabSheet4: TRzTabSheet;
    edtStrengthsComment: TRzEdit;
    edtWeakComments: TRzEdit;
    RzBitBtn2: TRzBitBtn;
    ADOConnection1: TADOConnection;
    procedure btnMainCloseClick(Sender: TObject);
    procedure btnMainEvaluationClick(Sender: TObject);
    procedure gridEmpEvaluationCheckBoxClick(Sender: TObject; ACol,
      ARow: Integer; State: Boolean);
    procedure FormShow(Sender: TObject);
    procedure cbMainFilterNavbarClick(Sender: TObject);
    procedure btnSubjectAddClick(Sender: TObject);
    procedure btnSubjectRemoveClick(Sender: TObject);
    procedure btnSubjectSearchClick(Sender: TObject);
    procedure btnMainViewSubjectsClick(Sender: TObject);
    procedure spineditSubjectDownLeftClick(Sender: TObject);
    procedure spineditSubjectUpRightClick(Sender: TObject);
    procedure spinEmpSubjectDownLeftClick(Sender: TObject);
    procedure spinEmpSubjectUpRightClick(Sender: TObject);
    procedure btnDoneEvaluationClick(Sender: TObject);
    procedure gridEmpEvaluationClickCell(Sender: TObject; ARow,
      ACol: Integer);
    procedure edtActiveForEvaluationChange(Sender: TObject);
    procedure MainPageEmpEvalChange(Sender: TObject);
    procedure btnLoginAsClick(Sender: TObject);
    procedure RzBitBtn2Click(Sender: TObject);
    procedure dbgridEvaluationSummarySelectionChanged(Sender: TObject;
      ALeft, ATop, ARight, ABottom: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
    iDefUser:integer;
    iDefUserFName:string;
    iDefFullName:String;
    //AdoConnection1:TADOConnection;
    procedure AssignedToGrid(iNoCols:integer;iNoRows:integer;iDesignedID:integer;sGridTitle:string);
  end;

var
  frmEvaluatonModule: TfrmEvaluatonModule;

implementation

{$R *.dfm}

procedure TfrmEvaluatonModule.btnMainCloseClick(Sender: TObject);
begin
     Close;
end;

procedure TfrmEvaluatonModule.btnMainEvaluationClick(Sender: TObject);
var
   iCount:integer;
begin
     MainPageEmpEval.ActivePageIndex:=0;

     //QryEvalRecords.First;
     edtActiveForEvaluation.Text:=trim(QryEvalRecords.fieldbyname('SUBJECT').AsString);

     QryEvalQuestioner.Connection:= ADOConnection1;
     QryEvalQuestioner.Open;

     iCount:=QryEvalQuestioner.RecordCount;

     AssignedToGrid(12,iCount*3+2,0,'EvaluationGrid');

end;

procedure TfrmEvaluatonModule.AssignedToGrid(iNoCols:integer;iNoRows:integer;iDesignedID:integer;sGridTitle:string);
var
   i,x: integer;
   defColor:TColor;
begin
//

  case iDesignedID of
       0:
         begin

            with gridEmpEvaluation do
            begin

                 Clear;
                 ColCount:=iNoCols;
                 RowCount:=iNoRows;

                 if not QryEvalQuestioner.IsEmpty then
                 begin
                      QryEvalQuestioner.First;
                      i:=1;
                      ColWidths[1]:=18;
                      ColWidths[3]:=18;
                      ColWidths[5]:=18;
                      ColWidths[7]:=18;
                      ColWidths[2]:=250;
                      ColWidths[4]:=250;
                      ColWidths[6]:=250;
                      ColWidths[8]:=250;

                      MergeCells(1,0,10,1);//:= 'Labor Hours Income';
                      Cells[1,0] := 'Evaluation Questions';
                      with CellProperties[1,0] do
                      begin
                           Alignment:= taCenter;
                           ReadOnly:=true;
                           FontSize:=10;
                           FontStyle:=[fsbold];
                      end;
                      Cells[11,0]:= 'Ratings';
                      with CellProperties[11,0] do
                      begin
                           Alignment:= taCenter;
                           FontSize:=10;
                           FontStyle:=[fsBold];
                      end;


                      DefaultRowHeight:=20;
                      VAlignment:=vtaTop;
                      FixedRowHeight:=25;
                      defColor:=clYellow;

                      while not QryEvalQuestioner.Eof do
                      begin

                           x:=i;
                           if defColor = clYellow then
                              defColor:= cl3DLight
                           else
                               defColor:= clYellow;


                           MergeCells(1,i,10,1);//:= 'Labor Hours Income';
                           Cells[1,i] := trim(QryEvalQuestioner.fieldByName('PERSONALTRAITS').AsString);
                           with CellProperties[1,i] do
                           begin
                                Alignment:= taCenter;
                                ReadOnly:=true;
                                FontSize:=10;
                                FontStyle:=[fsbold];
                               // Color:= defColor;
                           end;

                           MergeCells(11,i,1,3);//:= 'Labor Hours Income';
                           Cells[11,i]:= '';
                           with CellProperties[11,i] do
                           begin
                                Alignment:= taCenter;
                                FontSize:=20;
                                FontStyle:=[fsBold];
                                ReadOnly:=true;
                                //Font.Color:=clWhite;
                                VAlignment:=vtaCenter;
                                //Color:= clHotLight;
                           end;

                           MergeCells(0,i,1,3);//:= 'Labor Hours Income';
                           Cells[0,i] := trim(QryEvalQuestioner.fieldByName('EvalQuestionerKey').AsString);
                           CellProperties[0,i].Alignment:= taCenter;


                           MergeCells(1,i+1,10,1);//s= QryDTRSummary.FieldByName('NOOFHRSDUTY').AsString;
                           Cells[1,i+1] := trim(QryEvalQuestioner.fieldByName('DESCRIPTION1').AsString);;
                           with CellProperties[1,i+1] do
                           begin
                                Alignment:= taCenter;
                                ReadOnly:=true;
                                FontSize:=9;
                                FontStyle:=[fsitalic];
                                //Color:= defColor;
                           end;



                           i:=i+1;
                           AddCheckBox(1,i+1,True,True);
                           CellProperties[1,i+1].Alignment:= taCenter;
                           Cells[2,i+1] := trim(QryEvalQuestioner.fieldByName('UNSATISFACTORY').AsString);;
                           CellProperties[2,i+1].Alignment:= taLeftJustify;

                           AddCheckBox(3,i+1,True,True);
                           CellProperties[3,i+1].Alignment:= taCenter;
                           Cells[4,i+1] := trim(QryEvalQuestioner.fieldByName('SDEFICIENCESE').AsString);;
                           with CellProperties[4,i+1] do
                           begin
                                Alignment:= taLeftJustify;
                                ReadOnly:=true;
                                FontSize:=8;
                                //Color:= defColor;
                           end;

                           AddCheckBox(5,i+1,True,True);
                           CellProperties[5,i+1].Alignment:= taCenter;
                           Cells[6,i+1] := trim(QryEvalQuestioner.fieldByName('SATISFACTORY').AsString);;
                           with CellProperties[6,i+1] do
                           begin
                                Alignment:= taLeftJustify;
                                ReadOnly:=true;
                                FontSize:=8;
                               // Color:= defColor;
                           end;

                           AddCheckBox(7,i+1,True,True);
                           CellProperties[7,i+1].Alignment:= taCenter;
                           Cells[8,i+1] := trim(QryEvalQuestioner.fieldByName('EXCEPTIONAL').AsString);;
                           with CellProperties[8,i+1] do
                           begin
                                Alignment:= taLeftJustify;
                                ReadOnly:=true;
                                FontSize:=8;
                                //Color:= defColor;
                           end;

                           AddCheckBox(9,i+1,True,True);
                           CellProperties[9,i+1].Alignment:= taCenter;
                           Cells[10,i+1] := trim(QryEvalQuestioner.fieldByName('CLEARLYOUTSTANDING').AsString);;
                           with CellProperties[10,i+1] do
                           begin
                                Alignment:= taLeftJustify;
                                ReadOnly:=true;
                                FontSize:=8;
                                //Color:= defColor;
                           end;

                           i:=i+2;
                           QryEvalQuestioner.Next;
                      end;
            end;

         end;

     end;
     end;
end;

procedure TfrmEvaluatonModule.gridEmpEvaluationCheckBoxClick(
  Sender: TObject; ACol, ARow: Integer; State: Boolean);
begin
     with gridEmpEvaluation do
     begin

          case ACol of
               1:
                 begin
                   Cells[3,ARow]:=CheckFalse;
                   Cells[5,ARow]:=CheckFalse;
                   Cells[7,ARow]:=CheckFalse;
                   Cells[9,ARow]:=CheckFalse;
                   Cells[11,ARow]:='1';
                 end;
               3:
                 begin
                   Cells[1,ARow]:=CheckFalse;
                   Cells[5,ARow]:=CheckFalse;
                   Cells[7,ARow]:=CheckFalse;
                   Cells[9,ARow]:=CheckFalse;
                   Cells[11,ARow]:='2';
                 end;
               5:
                 begin
                   Cells[3,ARow]:=CheckFalse;
                   Cells[1,ARow]:=CheckFalse;
                   Cells[7,ARow]:=CheckFalse;
                   Cells[9,ARow]:=CheckFalse;
                   Cells[11,ARow]:='3';
                 end;
              7:
                 begin
                   Cells[3,ARow]:=CheckFalse;
                   Cells[5,ARow]:=CheckFalse;
                   Cells[1,ARow]:=CheckFalse;
                   Cells[9,ARow]:=CheckFalse;
                   Cells[11,ARow]:='4';
                 end;
              9:
                 begin
                   Cells[3,ARow]:=CheckFalse;
                   Cells[5,ARow]:=CheckFalse;
                   Cells[1,ARow]:=CheckFalse;
                   Cells[7,ARow]:=CheckFalse;
                   Cells[11,ARow]:='5';
                 end;

          end;
     end;

end;

procedure TfrmEvaluatonModule.FormShow(Sender: TObject);
begin
     QryEmployee.Connection:=ADOConnection1;
     QryEmployee.Open;
     QryEvalRecords.Connection:=ADOConnection1;
     QryEvalRecords.Open;
     //QryEvalQuestioner.Open;
     QryEmployee.Locate('EMPLOYEECODE',iDefUser,[]);
     iDefFullName:=trim(QryEmployee.fieldbyname('DTRLINKNAME').AsString);
     btnSubjectAdd.Enabled:=(trim(QryEmployee.fieldbyname('SUPERIOR').AsString)='Y');
     btnSubjectRemove.Enabled:=(trim(QryEmployee.fieldbyname('SUPERIOR').AsString)='Y');
     btnLoginAs.Enabled:=(trim(QryEmployee.fieldbyname('SUPERIOR').AsString)='Y');

     QryEvalRecords.Filter:='EVALUATEDBY =''' + iDefFullName + '''';
     QryEvalRecords.Filtered:=True;
     QryEmployee.First;
     rzStatusMainEvaluation.Caption:='Logged in as: (' + inttostr(iDefUser) + ') - ' + iDefFullName;
     MainPageEmpEval.ActivePageIndex:=0;
     //showmessage(trim(QryEmployee.fieldbyname('DTRLINKNAME').AsString) + '--' + trim(QryEmployee.fieldbyname('SUPERIOR').AsString));

end;

procedure TfrmEvaluatonModule.cbMainFilterNavbarClick(Sender: TObject);
begin
     QryEmployee.Filtered:=(cbMainFilterNavbar.Checked);
end;

procedure TfrmEvaluatonModule.btnSubjectAddClick(Sender: TObject);
begin

    if trim(edtCurrentNameEmp.Text)='' then
     begin
       Application.MessageBox('No Subject selected.', 'Subject required', MB_ICONEXCLAMATION);
       edtCurrentNameEmp.SetFocus;
       Exit;
     end;


     with QryEvalRecords do
     begin
          Append;
          FieldByName('SUBJECT').AsString:=trim(edtCurrentNameEmp.Text);
          FieldByName('EVALUATEDBY').AsString:=trim(iDefFullName);
          FieldByName('DATEMODIFIED').AsDateTime:=Now();
          Post;
          Requery;
     end;
     dbgridEvaluationSummary.Refresh;

end;

procedure TfrmEvaluatonModule.btnSubjectRemoveClick(Sender: TObject);
begin
     QryEvalRecords.Delete;
     QryEvalRecords.Requery;
     dbgridEvaluationSummary.Refresh;

end;

procedure TfrmEvaluatonModule.btnSubjectSearchClick(Sender: TObject);
begin
     if trim(edtSearchSubject.Text)='' then
     begin
       Application.MessageBox('Enter text to filter.', 'Subject required', MB_ICONEXCLAMATION);
       edtSearchSubject.SetFocus;
       Exit;
     end;

     if cbMainFilterNavbar.Checked then
     begin
          with QryEmployee do
          begin
               Filter:='DTRLINKNAME LIKE ''%' + TRIM(edtSearchSubject.Text)  + '%''';
               Filtered:=True;
          end;
     end else
     begin
          with QryEvalRecords do
          begin
               Locate('SUBJECT',TRIM(edtSearchSubject.Text),[loPartialKey]);
              //dbgridEvaluationSummary.Refresh;
          end;
     end;
end;

procedure TfrmEvaluatonModule.btnMainViewSubjectsClick(Sender: TObject);
var
i:integer;
begin



 with dbgridEvaluationSummary do
   begin
        //ColCount:=20;
        for i:=1 to 20 do
        begin
                Fields.Add;
        end;

        DefaultColWidth:=50;
        FixedColWidth:=8;
        ColWidths[1]:=8;        
        ColWidths[2]:=220;
        ColWidths[3]:=150;
        { if i >3 then
                begin
                   ColWidths[i]:=20;
                   Fields[i].Alignment:= taCenter;
                end;}

        Fields[1].FieldName:= 'SUBJECT';
        Fields[1].Title:=' Subject ';
        Fields[1].Alignment:= taLeftJustify;

        Fields[2].FieldName:= 'DATEEVALUATED';
        Fields[2].Title:=' Eval. Date ';
        Fields[2].Alignment:= taCenter;

        Fields[3].FieldName:= 'Q1';
        Fields[3].Title:='Q1';
        Fields[3].Alignment:= taCenter;

        Fields[4].FieldName:= 'Q2';
        Fields[4].Title:='Q2';
        Fields[4].Alignment:= taCenter;

        Fields[5].FieldName:= 'Q3';
        Fields[5].Title:='Q3';
        Fields[5].Alignment:= taCenter;

        Fields[6].FieldName:= 'Q4';
        Fields[6].Title:='Q4';
        Fields[6].Alignment:= taCenter;

        Fields[7].FieldName:= 'Q5';
        Fields[7].Title:='Q5';
        Fields[7].Alignment:= taCenter;

        Fields[8].FieldName:= 'Q6';
        Fields[8].Title:='Q6';
        Fields[8].Alignment:= taCenter;

        Fields[9].FieldName:= 'Q7';
        Fields[9].Title:='Q7';
        Fields[9].Alignment:= taCenter;

        Fields[10].FieldName:= 'Q8';
        Fields[10].Title:='Q8';
        Fields[10].Alignment:= taCenter;

        Fields[11].FieldName:= 'Q9';
        Fields[11].Title:='Q9';
        Fields[11].Alignment:= taCenter;

        Fields[12].FieldName:= 'Q10';
        Fields[12].Title:='Q10';
        Fields[12].Alignment:= taCenter;

        Fields[13].FieldName:= 'Q11';
        Fields[13].Title:='Q11';
        Fields[13].Alignment:= taCenter;

        Fields[14].FieldName:= 'Q12';
        Fields[14].Title:='Q12';
        Fields[14].Alignment:= taCenter;

        Fields[15].FieldName:= 'Q13';
        Fields[15].Title:='Q13';
        Fields[15].Alignment:= taCenter;

        Fields[16].FieldName:= 'Q14';
        Fields[16].Title:='Q14';
        Fields[16].Alignment:= taCenter;

        Fields[17].FieldName:= 'Q15';
        Fields[17].Title:='Q15';
        Fields[17].Alignment:= taCenter;


        Refresh;
   end;

    MainPageEmpEval.ActivePageIndex:=1;

end;

procedure TfrmEvaluatonModule.spineditSubjectDownLeftClick(
  Sender: TObject);
begin
     QryEmployee.Prior;
     edtCurrentNameEmp.Text:= trim(QryEmployee.fieldbyname('DTRLINKNAME').AsString);
end;

procedure TfrmEvaluatonModule.spineditSubjectUpRightClick(Sender: TObject);
begin
     QryEmployee.Next;
     edtCurrentNameEmp.Text:= trim(QryEmployee.fieldbyname('DTRLINKNAME').AsString);
end;

procedure TfrmEvaluatonModule.spinEmpSubjectDownLeftClick(Sender: TObject);
begin
     QryEvalRecords.Prior;
     edtActiveForEvaluation.Text:= trim(QryEvalRecords.fieldbyname('SUBJECT').AsString);
end;

procedure TfrmEvaluatonModule.spinEmpSubjectUpRightClick(Sender: TObject);
begin
     QryEvalRecords.Next;
     edtActiveForEvaluation.Text:= trim(QryEvalRecords.fieldbyname('SUBJECT').AsString);

end;

procedure TfrmEvaluatonModule.btnDoneEvaluationClick(Sender: TObject);
var
iValue:integer;
begin
    
     with QryEvalRecords do
     begin
          Edit;
              if trim(gridEmpEvaluation.Cells[11,1])<>'' then
                 FieldByName('Q1').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,1]);
              if trim(gridEmpEvaluation.Cells[11,4])<>'' then
                 FieldByName('Q2').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,4]);
              if trim(gridEmpEvaluation.Cells[11,7])<>'' then
                 FieldByName('Q3').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,7]);
              if trim(gridEmpEvaluation.Cells[11,10])<>'' then
                 FieldByName('Q4').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,10]);
              if trim(gridEmpEvaluation.Cells[11,13])<>'' then
                 FieldByName('Q5').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,13]);
              if trim(gridEmpEvaluation.Cells[11,16])<>'' then
                 FieldByName('Q6').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,16]);
              if trim(gridEmpEvaluation.Cells[11,19])<>'' then
                 FieldByName('Q7').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,19]);
              if trim(gridEmpEvaluation.Cells[11,22])<>'' then
                 FieldByName('Q8').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,22]);
              if trim(gridEmpEvaluation.Cells[11,25])<>'' then
                 FieldByName('Q9').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,25]);
              if trim(gridEmpEvaluation.Cells[11,28])<>'' then
                 FieldByName('Q10').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,28]);
              if trim(gridEmpEvaluation.Cells[11,31])<>'' then
                 FieldByName('Q11').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,31]);
              if trim(gridEmpEvaluation.Cells[11,34])<>'' then
                 FieldByName('Q12').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,34]);
              if trim(gridEmpEvaluation.Cells[11,37])<>'' then
                 FieldByName('Q13').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,37]);
              if trim(gridEmpEvaluation.Cells[11,40])<>'' then
                 FieldByName('Q14').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,40]);
              if trim(gridEmpEvaluation.Cells[11,43])<>'' then
                 FieldByName('Q15').AsInteger:=strtoint(gridEmpEvaluation.Cells[11,43]);

              FieldByName('DATEEVALUATED').AsDateTime:= dtEvalDate.DateTime;
              FieldByName('DATEMODIFIED').AsDateTime:=Now();
              FieldByName('STRONGREMARKS').AsString:=trim(edtStrengthsComment.Text);
              FieldByName('WEKNESSREMARKS').AsString:=trim(edtWeakComments.Text);


          Post;
     end;

     Application.MessageBox('Evaluation has been posted. Evaluate the next person.', 'Posted', MB_ICONEXCLAMATION);
     //spineditSubject.SetFocus;
     //MainPageEmpEval.ActivePageIndex:=1;     
     QryEvalRecords.Next;
     edtActiveForEvaluation.Text:=trim(QryEvalRecords.fieldbyname('SUBJECT').AsString);  
          
end;

procedure TfrmEvaluatonModule.gridEmpEvaluationClickCell(Sender: TObject;
  ARow, ACol: Integer);
begin
     //showmessage(inttostr(ACol) + '-' + inttostr(ARow));
end;

procedure TfrmEvaluatonModule.edtActiveForEvaluationChange(
  Sender: TObject);
begin
     btnDoneEvaluation.Enabled:=(Trim(edtActiveForEvaluation.Text)<>'');
end;

procedure TfrmEvaluatonModule.MainPageEmpEvalChange(Sender: TObject);
begin
     btnDoneEvaluation.Enabled:=(MainPageEmpEval.ActivePageIndex=0);
   
end;

procedure TfrmEvaluatonModule.btnLoginAsClick(Sender: TObject);
begin
    iDefUser:=QryEmployee.fieldbyname('EMPLOYEECODE').AsInteger;
    iDefFullName:= trim(QryEmployee.fieldbyname('DTRLINKNAME').AsString);

     QryEmployee.Open;
     QryEvalRecords.Open;
     //QryEvalQuestioner.Open;
     QryEmployee.Locate('EMPLOYEECODE',iDefUser,[]);
     iDefFullName:=trim(QryEmployee.fieldbyname('DTRLINKNAME').AsString);
     QryEvalRecords.Filter:='EVALUATEDBY =''' + iDefFullName + '''';
     QryEvalRecords.Filtered:=True;
     QryEmployee.First;
     rzStatusMainEvaluation.Caption:='Logged in as: (' + inttostr(iDefUser) + ') - ' + iDefFullName;
    
end;

procedure TfrmEvaluatonModule.RzBitBtn2Click(Sender: TObject);
begin
     QryEmployee.Filtered:=False;
     //QryEvalRecords.Filtered:=False;     
end;

procedure TfrmEvaluatonModule.dbgridEvaluationSummarySelectionChanged(
  Sender: TObject; ALeft, ATop, ARight, ABottom: Integer);
begin
     IF trim(QryEvalRecords.fieldbyname('SUBJECT').AsString)<>'' THEN
     edtActiveForEvaluation.Text:=trim(QryEvalRecords.fieldbyname('SUBJECT').AsString);
end;

end.
